<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="mainMenu" />
<meta name="nav" content="0" />
<meta name="acc" content="0" />
<title>用户部门</title>
<script type="text/javascript"
	src="<c:url value='/ext/ui/jquery-ui-1.8.12.custom.min.js'/>"></script>
<link href="${ctx}/styles/lightness/jquery-ui-1.8.12.custom.css"
	rel="stylesheet" />
<script>
	$(document).ready(function() {
		$("input[name='startDate']").addClass("Wate").bind("click", function() {
			WdatePicker({
				skin : 'whyGreen',
				minDate : '1900-10-01',
				maxDate : '#F{$dp.$D(\'endDate\')||\'%y-%M-%d\'}',
				dateFmt : 'yyyy-MM-dd'
			});
		});
		$("input[name='endDate']").addClass("Wate").bind("click", function() {
			WdatePicker({
				skin : 'whyGreen',
				minDate : '#F{$dp.$D(\'startDate\')}',
				dateFmt : 'yyyy-MM-dd'
			});
		});
		$("#username").focus();
		$("#inputForm").validate({
			rules:{
				"user.name":{
					required:true,
				},
				"department.id":{
					required:true,
				},
				startDate:{
					required:true,
				},
				endDate:{
					required:true,
				},
				"user.email":{
					required:true,
					email:true,
					remote:"${ctx}/project/sign/org/userdepartment!checkEmail.action?oldEmail=${user.email}",
				},
				"dept.id":{
					required:true
				},
				"user.age":{
					max:120,
					min:0
				}
			},
			messages:{
				"user.name":{
					required:"必须输入用户名：",
				},
				startDate:{
					required:"必须选择开始时间！",
				},
				"department.id":{
					required:"请选择用户部门",
				},
				endDate:{
					required:"必须选择结束时间！",
				},
				"user.email":{
					required:"必须输入邮箱！",
					email:"请输入正确格式的邮箱！",
					remote:"该邮箱已被使用！",
				}
			}
		});
	});

</script>
</head>
<body>
<form action="${ctx}/project/sign/org/userdepartment!save.action" method="post" class="yform"
	id="inputForm"><input type="hidden" name="id" value="${id }" />
<div id="caption" ><h6>添加人员信息</h6></div>
<table class="noborder">
	<tr class="type-text">
		<td>用户姓名</td>
		<td><input type="text" id="username" value="${user.name}" name="user.name" />
		<input type="hidden" name="deptId" value="${deptId}" /> <input
			type="hidden" name="typeId" value="${typeId}" /> <input
			type="hidden" name="projectId" value="${projectId}" /> <input
			type="hidden" name="organizationId" value="${organizationId}" /></td>
		<td>性别</td>
		<td>
		<s:select list="{'男','女'}" name="user.sex"></s:select>
		</td>
	</tr>
	<tr class="type-text">
		<td>年龄</td>
		<td><input type="text" value="${user.age }" name="user.age" /></td>
		<td>专业</td>
		<td><input type="text" value="${user.specialty }"
			name="user.specialty" /></td>
	</tr>
	<tr class="type-text">
		<td>职称</td>
		<td><input type="text" value="${user.dutyName}"
			name="user.dutyName" /></td>
		<td>职务</td>
		<td><input type="text" value="${officalPosition }"
			name="officalPosition" /></td>
	</tr>

	<tr class="type-text">
		<td>学历</td>
		<td><pt:code category="1002" name="degreeSet" toScope="request"></pt:code>
		<s:select list="#request.degreeSet" listKey="value"  listValue="label" name="user.degree" ></s:select>
		</td>
		
	    <td>部门名称</td>
		<td><pt:labels type="dept" name="depts" argument1="${empty (param.deptId)?(organizationId):(param.deptId)}" argument2="${typeId}"
			toScope="request" ></pt:labels>
			<s:select id="depSet" list="#request.depts" emptyOption="请选择"  listKey="value"  listValue="label" name="dept.id">
			</s:select>
		</td>
		
	</tr>
	<tr class="type-text">
		<td>电子邮箱</td>
		<td><input type="text" value="${user.email}" name="user.email" /></td>
		<td>移动电话</td>
		<td><input type="text" value="${user.mobilePhone}" name="user.mobilePhone" /></td>
	</tr>
	<tr class="type-text"> 
		<td>固定电话</td>
		  <td ><input name="user.phone" value="${user.phone}" type="text" />
		</td>
	</tr>
	<tr class="type-text">
		<td>开始时间</td>
		<td><input type="text" readonly="readonly" id="startDate"
			name="startDate" value="${startDate }" /></td>
		<td>结束时间</td>
		<td><input type="text" readonly="readonly" id="endDate"
			name="endDate" value="${endDate }" /></td>
	</tr>
	<tr class="type-text">
		<td>备注</td>
		<td colspan="3"><textarea rows="3" cols="60" name="remark">${remark }</textarea>
		</td>
	</tr>
</table>
		<div class="type-button"><input id="submitBtn"   type="submit"
			class="submit" value="提交"  />&nbsp; <input  
			type="button" value="关闭" class="reset"  onclick="_cloBtn();"  /></div>
</form>
</body>
</html>